unit FrmMain;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, FireDAC.Stan.Intf, FireDAC.Stan.Option,
  FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def,
  FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, Data.DB,
  FireDAC.Comp.Client, Vcl.StdCtrls, Vcl.Buttons, SqlExpr, Data.DbxDatasnap,
  IPPeerClient, Data.DBXCommon;

type
  TForm3 = class(TForm)
    FDConnection1: TFDConnection;
    Edit1: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Edit2: TEdit;
    Label3: TLabel;
    Edit3: TEdit;
    BitBtn1: TBitBtn;
    SQLConnection1: TSQLConnection;
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form3: TForm3;

implementation

{$R *.dfm}

procedure TForm3.BitBtn1Click(Sender: TObject);
var
  R: OleVariant;
  Obj: TSQLServerMethod;
begin
  try
    Self.SQLConnection1.Connected := True;
    if Self.SQLConnection1.Connected then
    begin
      Obj := TSQLServerMethod.Create(Self);
      try
        Obj.SQLConnection := SQLConnection1;
        Obj.ServerMethodName := 'TServerMethods1.EchoString';
        Obj.Params[0].AsString := 'abc';
        Obj.ExecuteMethod;
        R := Obj.Params[1].Value;
        ShowMessage(VarToStr(R));
      finally
        Obj.Free;
      end;
    end;
  finally

  end;
end;

end.
